package com.example.design.state;

import com.example.design.state.enums.DemandState;
import lombok.Data;

/**
 * 状态流转.
 *
 * @author duk
 * @date 2024-01-15 13:42
 */
@Data
public class Transition {

    /**
     * 当前状态
     */
    private final Integer currentState;
    /**
     * 下一个状态
     */
    private final Integer nextState;

    /**
     * 创建状态流转
     */
    public static Transition transition(DemandState currentState, DemandState nextState) {
        return new Transition(currentState.getState(), nextState.getState());
    }

}
